﻿{extend name="Public:base"/}

{block name="main"}
<div class="box-info">
    <div class="table-toolbar">
        <a class="btn btn-primary" href="{:U('Slide/index')}"><i class="fa fa-reply"></i>返回广告列表</a>
        <a class="btn btn-primary" href="{:U('Slide/addpic?fid='.$slide[id])}">添加图片</a>
        <button class="btn btn-primary" onclick="myform.action='{:U('Slide/listorder')}';$('#myform').submit();">排序</button>
    </div>

    <form name="myform" id="myform" action="" method="post">
        <table class="table table-bordered">
            <thead>
            <tr>
                <th width="48">排序</th>
                <th align="left">缩率图</th>
                <th width="140" class="center">操作</th>
            </tr>
            </thead>
            <tbody>
            {volist name="list" id="vo" key="k"}
            <tr>
                <td width="40" class='center'><input name='listorders[{$vo.id}]' type='text' size='3'
                        value='{$vo.listorder}' class='input-text-c'></td>
                <td align="left"><img src="{$vo['pic']}" onload="if(this.width >= 320){this.width = 320}"></td>
                <td class="center">
                    <a class="btn btn-sm btn-primary" href="{:U('Slide/editpic',array(fid=>$fid,id=>$vo['id']))}">编辑</a>
                    <a class="btn btn-sm btn-danger"
                            href="javascript:confirm_delete('{:U('Slide/deletepic',array(id=>$vo['id']))}')">删除</a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
    </form>
    <div class="pagination">{$page}</div>
</div>
{/block}